﻿using YAPACS.BusinessObjects.Managements.Exams;
using YAPACS.RisServer.Services.Dtos;
using YAPACS.Workflows;

namespace YAPACS.RisServer.Abstractions;

public interface IReportService
{
    /// <summary>
    /// 快速查询检查列表
    /// </summary>
    /// <param name="filterId"></param>
    /// <param name="take"></param>
    /// <param name="skip"></param>
    /// <param name="searchValue"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamListByFilterAsync(DataGridRequest request);
    /// <summary>
    /// 获取高级查询视图
    /// </summary>
    /// <returns></returns>
    Task<WorkflowOutput> GetAdvancedSearchViewAsync();
    /// <summary>
    /// 书写报告
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> WriteReportAsync(Guid examId);
    /// <summary>
    /// 获取检查信息
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamAsync(Guid reportId);
    /// <summary>
    /// 获取检查form-view
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetExamViewAsync(Guid reportId);
    /// <summary>
    /// 保存报告
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> SaveReportAsync(ReportDto reportDto);
    /// <summary>
    /// 提交报告
    /// </summary>
    /// <param name="reportId"></param>
    /// <param name="complete"></param>
    /// <returns></returns>
    Task<WorkflowOutput> SubmitReportAsync(Guid reportId, Guid? auditUserId, bool complete);
    /// <summary>
    /// 撤回报告
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> RevokeReportAsync(Guid examId, Guid reviseType, string reason);
    /// <summary>
    /// 审核报告
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> AuditReportAsync(Guid examId);
    /// <summary>
    /// 标记随访
    /// </summary>
    /// <param name="reportId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> MarkFollowUpAsync(Guid reportId);
    /// <summary>
    /// 获取随访记录
    /// </summary>
    /// <param name="reportId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetFollowUpRecordAsync(Guid reportId);
    /// <summary>
    /// 回访
    /// </summary>
    /// <param name="reportId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> RevisitAsync(Guid reportId);
    /// <summary>
    /// 查看电子申请单
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetEApplyAsync(Guid examId);
    /// <summary>
    /// 查看电子病历
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetEMedicalAsync(Guid examId);
    /// <summary>
    /// 获取危急值
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> GetCriticalValueAsync(Guid reportId);
    /// <summary>
    /// 获取收藏列表
    /// </summary>
    /// <returns></returns>
    Task<WorkflowOutput> GetCollectionMenuAsync(List<Guid> examIds, bool collect);
    /// <summary>
    /// 收藏
    /// </summary>
    /// <param name="menuId"></param>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> CollectAsync(List<Guid> examIds, List<Guid> menuIds);
    /// <summary>
    /// 取消收藏 批量
    /// </summary>
    /// <param name="examIds"></param>
    /// <param name="examFlagIds"></param>
    /// <returns></returns>
    Task<WorkflowOutput> CancelCollectAsync(List<Guid> examIds, List<Guid> examFlagIds);
    /// <summary>
    /// 图像评估
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> ImageAssessmentAsync(Guid examId);
    /// <summary>
    /// 报告评分
    /// </summary>
    /// <param name="examId"></param>
    /// <returns></returns>
    Task<WorkflowOutput> ScoreAsync(Guid examId);

    Task<WorkflowOutput> GetPdfFileAsync(IList<Guid> examIds, ReportStyleType reportStyleType);

    Task<WorkflowOutput> AmendReportAsync(Guid examId, Guid reviseType, string reason);

    Task<WorkflowOutput> RejectReportAsync(Guid examId, Guid reviseType, string reason);

    Task<WorkflowOutput> UpdateExamReportStyleAsync(Guid reportId, ReportDto reportDto);
    Task<WorkflowOutput> GiveUpWriteReportAsync(Guid reportId);
    /// <summary>
    /// 移交
    /// </summary>
    /// <param name="input"></param>
    /// <param name="nextApi"></param>
    /// <returns></returns>
    Task<WorkflowOutput> TransferReportAsync(WorkflowInput input, string nextApi = null);
    /// <summary>
    /// 拆分检查
    /// </summary>
    /// <param name="examId"></param>
    /// <param name="examItemIds"></param>
    /// <returns></returns>
    Task<WorkflowOutput> DisassembleAsync(Guid examId, List<Guid> examItemIds);

    /// <summary>
    /// 验证用户
    /// </summary>
    /// <param name="input"></param>
    /// <param name="nextApi"></param>
    /// <returns></returns>
    Task<WorkflowOutput> VerifyUserAsync(WorkflowInput input, string nextApi = null);
    Task<WorkflowOutput> ExportAsync(DataGridRequest request);
    Task<WorkflowOutput> GeneratePdfFileAsync(IList<Guid> examIds, ReportStyleType reportStyleType);
}
